package com.mibotiquin.alarmas;

import com.mibotiquin.DbHelper.DatabaseItem;

public class ItemAlarm implements DatabaseItem {
	
	private String idAlarm;
	private String nombAlarm;
	private String fechInicAlarm;
	private String horaInicAlarm;
	private String frecAlarm; //In useconds
	private String duracAlarm; //In days
	private String descripAlarm;
	private String nomMed;
	private String fechFinAlarm;

	public ItemAlarm(String[] data) {
		
		idAlarm = data[0];
		nombAlarm = data[1];
		fechInicAlarm = data[2];
		horaInicAlarm = data[3];
		frecAlarm = data[4];
		duracAlarm = data[5];
		descripAlarm = data[6];
		nomMed = data[7];
		fechFinAlarm = data[8];

	}

	public ItemAlarm() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public String[] getCamposArray() {
		String[] campos = {"idAlarma", "nombAlarm", "fechInicAlarm", "horaInicAlarm", "frecAlarm", "duracAlarm", "descripAlarm", "nomMed",
							"fechFinAlarm"};
		return campos;
	}

	@Override
	public String[] getDatosArray() {
		String[] campos = { String.valueOf(idAlarm), nombAlarm, fechInicAlarm, horaInicAlarm, String.valueOf(frecAlarm), 
							String.valueOf(duracAlarm), descripAlarm, nomMed, fechFinAlarm};
		return campos;
	}

	@Override
	public String getNombreTabla() {
		return "planificacion";
	}

	@Override
	public DatabaseItem getInstance(String[] data) {
		return new ItemAlarm(data);
	}

}
